/* 如风壁纸 - Base Styles */

:root {
    /* Morandı color palette */
    --color-primary: #a2b9bc;
    --color-secondary: #b2ad7f;
    --color-accent: #878f99;
    --color-light: #f6f6f6;
    --color-dark: #333333;
    --color-gray: #6b7c93;
    --color-muted: #e4e4e4;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overscroll-behavior: none;
}

/* iPhone 16 Pro Device Mockup */
.phone-container {
    width: 393px;
    height: 852px;
    background-color: white;
    border-radius: 45px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Status Bar */
.status-bar {
    height: 44px;
    width: 100%;
    position: absolute;
    top: 0;
    z-index: 10;
}

/* Content Area */
.content-area {
    height: calc(100% - 44px - 83px); /* Subtract status bar and tab bar heights */
    margin-top: 44px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tab Bar */
.tab-bar {
    height: 83px;
    width: 100%;
    position: absolute;
    bottom: 0;
    z-index: 10;
}

/* Wallpaper Grid Layout */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.wallpaper-item {
    position: relative;
    aspect-ratio: 9/16;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.wallpaper-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wallpaper-item:active {
    transform: scale(0.95);
}

/* Search Container */
.search-container {
    margin-bottom: 15px;
}

.search-container input {
    border: none;
    font-size: 14px;
}

.search-container input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

#clear-search {
    cursor: pointer;
}

#clear-search:hover {
    color: var(--color-dark);
}

/* Hide wallpaper items during search */
.wallpaper-item.hidden {
    display: none;
}

/* Category Card */
.category-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 120px;
    margin-bottom: 15px;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card .category-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-weight: 600;
}

/* Detail Page */
.detail-view {
    position: relative;
    width: 100%;
    height: 100%;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-buttons {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.action-btn:active {
    transform: scale(0.9);
    background-color: rgba(255, 255, 255, 0.4);
}

/* Navigation */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--color-light);
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
}

.page-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Settings Page */
.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--color-muted);
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Loading indicator */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: var(--color-gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Category filters */
.category-filters {
    display: flex;
    overflow-x: auto;
    padding: 15px 10px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--color-muted);
    color: var(--color-dark);
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-chip.active {
    background-color: var(--color-primary);
    color: white;
}

/* iOS style toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3478F6;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Swipe gesture indicator */
.swipe-indicator {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    width: 100%;
    font-size: 0.8rem;
}

.swipe-indicator i {
    font-size: 1.5rem;
    margin-bottom: 5px;
} 